<link href="images/tree/xtree.css" rel="stylesheet" type="text/css" />
<link href="images/tree/xmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="images/tree/xtree.js"></script>
<script type="text/javascript" src="images/tree/xmlextras.js"></script>
<script type="text/javascript" src="images/tree/xloadtree.js"></script>
<SCRIPT src="images/tree/xmenu.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript>
var elo;
var loadmenuok=false;
var type = 'main';
function goMain(action) {
	var main = parent.mainFrame;
	var top=parent.topFrame;
	top.document.getElementById('loadMsg').style.display='';
	main.location=action; 
}
function goNew(action){
	window.open(action);
	return;
}
function goDel(action){
	var msg = confirm('您确定要删除此目录么？删除之后所有目录下数据都将丢失!');
	if(msg){
		goMain(action);
		return;
	}else{
		return;
	}
	
}
function rightMenu(cid) {
	/*
	var toolMenu = new WebFXMenu;
	toolMenu.width = 90;
	if(cid == 'root')  {
		toolMenu.add(new WebFXMenuItem('新建目录','javascript:goMain("$admin_file?adminjob=category&action=add")','新建目录'));
		toolMenu.add(new WebFXMenuItem('统计{$very[contentName]}','javascript:goMain("$admin_file?adminjob=category&action=total")','统计{$very[contentName]}数'));
		//toolMenu.add(new WebFXMenuItem('更新首页','javascript:goMain("$admin_file?adminjob=category&action=pubindex")','更新首页'));
		//toolMenu.add(new WebFXMenuItem('目录管理','javascript:goMain("$admin_file?adminjob=category&action=edit")','目录管理'));
		//toolMenu.add(new WebFXMenuItem('{$very[contentName]}查看','javascript:goMain("$admin_file?adminjob=content")','{$very[contentName]}查看'));
	} else {
		toolMenu.add(new WebFXMenuItem('添加新{$very[contentName]}','javascript:goMain("$admin_file?adminjob=edit&action=add&cid='+ cid +'")','新建文档'));
		//toolMenu.add(new WebFXMenuItem('查看此首页','javascript:goNew("$admin_file?adminjob=category&action=viewlist&cid='+ cid +'")','查看首页'));
		//toolMenu.add(new WebFXMenuItem('更新此首页','javascript:goMain("$admin_file?adminjob=category&action=publist&cid='+ cid +'")', '更新目录首页'));
		toolMenu.add(new WebFXMenuItem('目录设置','javascript:goMain("$admin_file?adminjob=category&action=edit&action=edit&cid='+ cid +'")','目录设置'));
		toolMenu.add(new WebFXMenuItem('添加子目录','javascript:goMain("$admin_file?adminjob=category&action=add&up='+ cid +'")','添加子目录'));
		//toolMenu.add(new WebFXMenuItem('发布此目录','javascript:goMain("$admin_file?adminjob=category&action=pubview&cid='+ cid +'")', '发布此目录'));
		//toolMenu.add(new WebFXMenuItem('更新此目录','javascript:goMain("$admin_file?adminjob=category&action=pubupdate&cid='+ cid +'")', '更新此目录'));
		toolMenu.add(new WebFXMenuItem('删除此目录','javascript:goDel("$admin_file?adminjob=category&action=del&cid='+ cid +'")', '删除此目录'));
	}
		//var menudata = document.getElementById('menudata');
		menudata.innerHTML = toolMenu ;

		elo=window.event.srcElement;
		toolMenu.left = window.event.clientX;
		toolMenu.top = window.event.clientY+document.body.scrollTop;
		toolMenu.show();
	*/	

}
/// XP Look
webFXTreeConfig.rootIcon		= "images/tree/new/root.png";
webFXTreeConfig.openRootIcon	= "images/tree/new/root.png";
webFXTreeConfig.folderIcon		= "images/tree/new/book.png";
webFXTreeConfig.openFolderIcon	= "images/tree/new/book_open.png";
webFXTreeConfig.fileIcon		= "images/tree/new/file.png";
webFXTreeConfig.lMinusIcon		= "images/tree/new/Lminus.png";
webFXTreeConfig.lPlusIcon		= "images/tree/new/Lplus.png";
webFXTreeConfig.tMinusIcon		= "images/tree/new/Tminus.png";
webFXTreeConfig.tPlusIcon		= "images/tree/new/Tplus.png";
webFXTreeConfig.iIcon			= "images/tree/new/I.png";
webFXTreeConfig.lIcon			= "images/tree/new/L.png";
webFXTreeConfig.tIcon			= "images/tree/new/T.png";


var rti;
var tree = new WebFXTree("Root");
<!--
EOT;
while($cate=$db->fetch_array($root)){
if (empty($login) && !$cate['guestview']) continue; //游客不能看
if (!empty($cate['groupids']) && !in_array($login['groupid'], explode(',', $cate['groupids']))) continue;
if(count($children[$cate[cid]])>0){
print <<<EOT
-->
	tree.add(new WebFXLoadTreeItem("$cate[cname]", "tree.php?action=showXML&cid=$cate[cid]","$very[url]/list.php?cid=$cate[cid]","$cate[cid]"));
<!--
EOT;
}else{
print <<<EOT
-->
tree.add(new WebFXTreeItem("$cate[cname]","$very[url]/list.php?cid=$cate[cid]","$cate[cid]"));
<!--
EOT;
}}
print <<<EOT
-->	
</script>
<div class="sidebar">
<h2>按文件类型浏览</h2>
<ul>
      <!--#if(!$typeid){$homeclass="here";}else{$homeclass="";}#-->
      <li><a href="type.php" id="menu_home"  class="$homeclass">全部</a></li>
      <!--# foreach($restype as $res){#-->
      <!--#if($res[typeid]==$typeid){$class="here";}else{$class='';}#-->
      <li><a href="type.php?typeid=$res[typeid]"  class="$class">$res[typename]</a></li>
      <!--#}#-->
</ul>
<div style="width:94%; padding:5px; border:#CCCCCC 1px solid; border-top:0;">
<script>
function showshiyong()
{
	alert("试用版部分功能暂不开放。"); 
	return false;
}
function upload()
{
	if(login_name == '')
	{
		alert("您尚未登录，请先登录");
		return false;
	}
	else
	{
	}
}
document.write(tree);
</script>
</div>
<div id="menudata">
</div>
</div>